<template>
  <div>
    <div class="header">
      <span>搜索用户数</span>
      <span>
        <svg t="1665400148315" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="4237" width="16" height="16">
          <path d="M512 64C264.8 64 64 264.8 64 512s200.8 448 448 448 448-200.8 448-448S759.2 64 512 64z m-32 192h64v64h-64v-64z m160 512H384v-64h96V458.4L400.8 480 384 418.4 511.2 384H544v320h96v64z" p-id="4238" fill="#8a8a8a"></path>
        </svg>
      </span>
    </div>
    <div class="mian">
      <span>12321</span>
      <span>
        17.1
        <i>
          <svg t="1665401043313" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2606" width="16" height="16"><path d="M512 405.333333L298.666667 618.666667h426.666666L512 405.333333z" fill="#d81e06" p-id="2607"></path></svg
          ><svg t="1665401105619" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="4611" width="16" height="16">
            <path d="M512 618.666667L298.666667 405.333333h426.666666L512 618.666667z" fill="#1afa29" p-id="4612"></path></svg></i
      ></span>
    </div>
    <div class="footer">
      <div class="myecharts" ref="myecharts"></div>
    </div>
  </div>
</template>

<script>
import * as echarts from 'echarts'
export default {
  name: 'LineCharts',
  mounted() {
    let myecharts = echarts.init(this.$refs.myecharts)
    myecharts.setOption({
      xAxis: {
        show: false,
        type: 'category',
      },
      yAxis: {
        show: false,
      },
      series: [
        {
          type: 'line',
          data: [30, 31, 32, 30, 29, 28, 27, 28, 29],
          // 拐点样式
          itemStyle: {
            opacity: 0,
          },
          // 线条的样式
          lineStyle: {
            color: 'red',
          },
          areaStyle: {
            color: {
              type: 'linear',
              x: 0,
              y: 0,
              x2: 0,
              y2: 1,
              colorStops: [
                {
                  offset: 0,
                  color: 'red', // 0% 处的颜色
                },
                {
                  offset: 1,
                  color: '#fff', // 100% 处的颜色
                },
              ],
              global: false, // 缺省为 false
            },
          },
        },
      ],
      grid: {
        left: 0,
        right: 0,
        top: 0,
        bottom: 0,
      },
    })
  },
}
</script>

<style scoped>
.header {
  display: flex;
  justify-content: space-between;
}
.myecharts {
  width: 100%;
  height: 50px;
}
</style>